function search(x,y){     
    $(x).click(function(){
        var a = $(y).html();
        var b = $(this).html();
        $(y).html(b);
        $(this).html(a);
    });
}
$(document).ready(function(){
    var x_header = $(".top .search li");
    var y_header = x_header[0];
    search(x_header,y_header);
    

    var x=$(".footer-nav .search li");    
    var y = x[0];
    search(x,y);
})